import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner num =  new Scanner(System.in);
        while(num.hasNext()){
            int n = num.nextInt();
            double s = num.nextDouble();
            RegularPolygon r = new RegularPolygon(n,s);
            System.out.println(r.getArea());
            System.out.println(r.getPerimeter());
        }
    }
}
